﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace ThePingMasterConfiguration.Commands
{
    public class RunProcessCommand : ICommand
    {
        private readonly string _processPath;

        public RunProcessCommand(string processPath)
        {
            if (processPath == null) throw new ArgumentNullException("processPath");
            _processPath = processPath;
        }


        public void Execute(object parameter)
        {
            Process.Start(new ProcessStartInfo(_processPath));
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
    }
}
